package com.danieldura.highrise.data
{
	public class PhoneNumber
	{
		public static const WORK:String 	= "Work";
		public static const MOBILE:String 	= "Mobile";
		public static const FAX:String 		= "Fax";
		public static const PAGER:String 	= "Pager";
		public static const HOME:String 	= "Home";
		public static const OTHER:String 	= "Other";
		
		public static var id:int;
		public static var number:String;
		public static var location:String;
		
		public function parse( data:XML ):void
		{
			id = data.id;
			number = data.number;
			location = data.location;
		}
		
		public function toXML():XML
		{
			var data:XML = new XML( "<phone-number></phone-number>" );
			data.id = id;
			data.number = number;
			data.location = location;
			return data;
		}
		
		public function toXMLString():String
		{
			return toXML().toXMLString();
		}		
	}
}

/*
      <id type="integer">2</id>
      <number>555-555-5555</number>
      <location>#{ Work || Mobile || Fax || Pager || Home || Other }</location>
*/